package com.comm.utils;

import java.util.List;

import com.comm.db.dao.TMyresumeDAO;
import com.comm.db.pojo.TMyresume;
 
public class MyResumeDaoUtil {
	public synchronized static void saveOrUpdate(Integer resumeid,
			Integer cvid, int sysuserid) {
		if (resumeid == null) {
			return;
		}
		TMyresumeDAO myDao = new TMyresumeDAO();
		TMyresume myresume = new TMyresume();

		List<TMyresume> list = myDao.findBySysuserid(sysuserid);
		if (cvid != null && StringUtil.isNotBlank(cvid) && cvid.intValue() > 0)
			myresume.setCvid(cvid);
		myresume.setResumeid(resumeid);
		myresume.setSysuserid(sysuserid);
		for (TMyresume resume : list) {
			if (resume.getResumeid().intValue() == resumeid.intValue()) {
				myresume = resume;
			}
		}

		myDao.saveOrUpdate(myresume);
	}
}
